<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title id="title">农家乐服务列表</title>
		<script src="../js/mui.min.js"></script>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/style.css" />
		<link rel="stylesheet" href="../css/member.css" />
		<link rel="stylesheet" href="../css/picker.css" />
		<link rel="stylesheet" href="../css/poppicker.css" />
		<link rel="stylesheet" type="text/css" href="../css/datepicker3.css" />
		<script src="../plugin/crop/croppie.min.js"></script>
		<link rel="stylesheet" href="../css/font-awesome.min.css" />
		<link rel="stylesheet" href="../css/bootstrap.min.css" />

	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title" id="top_title">农家乐服务列表</h1>
			<h1 class="mui-title list_search" id='search' style="display: none;">
				<input type="text" id='search_name' placeholder="输入商品">
				<button id="refurbish1" type="button">搜索</button></h1>
			<a onclick="select()" class="mui-icon mui-icon-search" style="float: right;"></a>
		</header>
		<div style="margin-top: 55px;" id="content">
			<!--<div class="mui-card-header mui-card-media">
	<img src="../images/logo.png" />
	<div class="mui-media-body">
		小M
		<p>发表于 2016-06-30 15:30</p>
	</div>
</div>-->
		</div>
		<div class="mui-content" id="selected" style="display: none;">
			<div class="gerenzl_nr">
				<form class="mui-input-group gerenzl_group">
					<div class="gerenzl_top img-click">

						<!--<div class="grzl_toux" id="touxiang">
			    		<div id="img_list" class="img_list">
			    			<img id="tupian" src="images/toux.jpg">
			    		</div>
			    		<button class="file-btn" id="btn_thumb" style="opacity:0;filter:alpha(opacity=0);height: 95px; width: 100px;position: absolute;top: -0px;left: -0px;z-index: 9;">
			                <span><i class=" fa fa-plus"></i></span>   
			                <input type="file" id="upload" name="upload" value="选择图片文件" style=" "multiple />
			          </button>
			    	</div>-->

						<div class="mui-input-row">
							<label>开始时间</label>
							<!--<input type="text"  name="birthday" id="birthday" class="datetimepicker" id="datetimepicker">-->
							<input type="text" id="sctime1" class="datetimepicker" id="datetimepicker">
						</div>
						<div class="mui-input-row">
							<label>结束时间</label>
							<!--<input type="text"  name="birthday" id="birthday" class="datetimepicker" id="datetimepicker">-->
							<input type="text" id="sctime2" class="datetimepicker" id="datetimepicker">
						</div>
						<div class="mui-input-row">
							<label>农家乐名称</label>
							<input type="text" id="shop" class="mui-input-group" placeholder="请输入店铺名">
						</div>
				
               	<div class="mui-input-row">
							<label>地址</label>
							<input type="text" id="district" class="mui-input-group" placeholder="请选择地区">
						</div> 

				</form>
				<div style="height: auto;" onclick="go()">
					<span>确定</span>
				</div>
				</div>

			</div>
		</div>
		<div id="footer"></div>
		<div id="allmap"></div>

	</body>

</html>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/app.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/castapp.js"></script>
<script type="text/javascript" src="../js/layer/layer.min.js"></script>
<script src="../js/app.js"></script>
<script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
<script src="../js/picker.js"></script>
<script src="../js/poppicker.js"></script>
<script src="../js/city.data-3.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script type="text/javascript">
	get_navigation();
	getFoot(getUrlParam("foot_active") > 0 ? getUrlParam("foot_active") : 1);
	var loading = layer.load(0, {
		shade: false,
		time: 1 * 1000
	});
</script>
<script>
	//底部加载事件
	$(window).scroll(function() {
		var a = $(document).scrollTop();
		var b = $(document).height() - $(window).height();

		if($(document).scrollTop() + 1 >= $(document).height() - $(window).height()) {
			var total_num = $("#total_num").val();
			var per_page = $("#per_page").val();
			var page_total = Math.ceil(parseInt(total_num) / parseInt(per_page));
			var cut_page = $("#cut_page").val();

			if(cut_page < page_total) {
				$("#cut_page").val(parseInt(cut_page) + 1);
				get_goods_list();
			} else {
				layer.msg("已到底部");
			}
		}
	});
</script>
<script>
	$(function() {
		$(".datetimepicker").datepicker({
			language: "zh-CN",
			autoclose: true, //选中之后自动隐藏日期选择框
			clearBtn: true, //清除按钮
			todayBtn: true, //今日按钮
			format: "yyyy-mm-dd" //日期格式，详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
		});

	});
	//搜索
	function go() {
		$.ajax({
			//type: 'post',
			url: APP.api_url + 'goods/serve_select',
			data: {
				sctime1: $('#sctime1').val(),
				sctime2: $('#sctime2').val(),
				district: $('#district').val(),
				shop: $('#shop').val()
			},
			dataType: 'jsonp',
			success: function(data) {
				if(data.code == 200) {
					var json = data.data;
					var strs = new Array(); //定义一数组 
					var goods_htm = '';
					if(json.length != 0) {
						for(var i = 0; i < json.length; i++) {
							var strs = json[i]['pic'].split("@"); //获取首图 		
					goods_htm += '<a href="serve_xq.html?id=' + json[i].id + '" ><div class="mui-card-header mui-card-media">' +
						'<img src="' + APP.pic_url + strs[0] + '" />' +
						'<div class="mui-media-body" style="width:50%;">' + json[i].title + '<p>分类:农家乐</p></div><div style="float:right;width:48%;color:#111111;margin-top:-40px; font-size:14px;">商家：' + json[i].shop_name + '</div><div style="float:right;color:#111111;width:48%;margin-top:-16px;font-size:12px;">地址: ' + json[i].address + '</div></div></a>';
				}
						goods_htm += '<div style="height:60px;width: 100%;float:left;"></div>';
					} else {
						goods_htm += '<img src="../images/qq1.png" />';
					}
					$("#content").empty();
					$("#content").append(goods_htm);
					$('#selected').hide();
					$('#content').show();

				} else {
					layer.msg('找不到相关信息的商品');
				}

			}
		})
	}

	//地址
//	ca.init();
//
//	var input = ca.tagName('input');
//	var dis = ca.id('district');
//	dis.addEventListener('tap', function() {
//		castapp.combinationSelect(3, cityData3, function(arr) {
//			dis.value = arr;
//		});
//	})
</script>
<script>
	//搜索
	function select() {
		$("#content").hide();
		$("#selected").show();
	}

	function clier() {
		$("#cut_page").val(1);
	}
</script>
<script>
	var goods = getUrlParam('data');
	//获取商品列表
	$.ajax({
		//type: 'post',
		url: APP.api_url + 'goods/serve_list',
		data: {},
		dataType: 'jsonp',
		success: function(data) {
			if(data.code == 200) {
				var json = data.list;
				var goods_htm = '';
				for(var i = 0; i < json.length; i++) {
					var strs = json[i]['pic'].split("@"); //获取首图 		
					goods_htm += '<a href="serve_xq.html?id=' + json[i].id + '" ><div class="mui-card-header mui-card-media">' +
						'<img src="' + APP.pic_url + strs[0] + '" />' +
						'<div class="mui-media-body" style="width:50%;">' + json[i].title + '<p>分类：农家乐</p></div><div style="float:right;width:48%;color:#111111;margin-top:-40px; font-size:14px;">商家：' + json[i].shop_name + '</div><div style="float:right;color:#111111;width:48%;margin-top:-16px;font-size:12px;">地址: ' + json[i].address + '</div></div></a>';
				}
				goods_htm += '<div style="height:60px;width: 100%;float:left;"></div>';
				$("#content").append(goods_htm);
				//									$('#content').style("background-color","red")
				//					alert(document.getElementById('content').style.background-color);
			}

		}
	})
</script>